package com.ashley.thread.test3;

/**
 * @author ashley
 * @date 2019/9/25-17:03
 */
//创建一个继承于Thread类的子类
public class MyThread extends Thread {
    //重写run方法，定义此线程执行的操作
    @Override
    public void run() {

        for (int i = 1; i <= 10; i++) {
            if (i % 2 == 0) {
                System.out.println(Thread.currentThread().getName() + ":" + i);
            }

        }
    }
}
